<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <teleport to='body'>
            <p>msg:{{msg}}</p>

        </teleport>
        <input type="button" value="切换渲染区域" @click="flag=!flag">
        <teleport to='#root' :disabled="flag">
            <p>info:{{info}}</p>
        </teleport> 
        <teleport to='.aa' >

            <div class="ad">
                广告：{{ad}}
            </div>
        </teleport>    
        
    </div>
    <div id="root"></div>
    <div class="aa"></div>
    <script type="module">
        import { createApp } from "../assets/vue3/vue.esm-browser.js";
        createApp({
            data() {
                return {
                    msg:'msg变量',
                    flag:false,
                    info:"info变量",
                    ad:'广告文案'
                }
            }
        }).mount("#app");
    </script>
</body>
</html>